package com.hhh.demo.sx.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hhh.demo.sx.bean.LayuiTree;
import com.hhh.demo.sx.bean.Menu;
import com.hhh.demo.sx.bean.Role;
import com.hhh.demo.sx.mapper.MenuMapper;
import com.hhh.demo.sx.mapper.RoleMapper;
import com.hhh.demo.sx.service.MenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author hhh
 * @since 2021-12-27
 */
@Service
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements MenuService {
    @Autowired
    private MenuMapper menuMapper;
    @Override
    public Page<Menu> findAll(Page<Menu> page, QueryWrapper wrapper) {

        return menuMapper.selectPage(page,wrapper);
    }

    @Override
    public List<LayuiTree> selectMenuTree(Integer id){
        return menuMapper.selectMenuTree(id);
    }

    @Override
    public List<LayuiTree> selectByUserId(Integer id) {
        return menuMapper.selectByUserId(id);
    }

    ;



}
